﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<div class="panel">
    <div class="panel_header">
        <% List<GetCategoryResult> listCategory = null;
           if (ViewData["SubMenu"] != null)
           {
               listCategory = (List<GetCategoryResult>)ViewData["SubMenu"];
               GetCategoryResult objParent = listCategory.Where(q => !q.ParentID.HasValue).FirstOrDefault();
               Response.Write("<a class='catname' alt='" + objParent.CategoryName + "' title='"
                   + objParent.CategoryName + "' href='" + FRouter._("danh-muc", objParent.Alias) +
                   "'>" + objParent.CategoryName + "</a></h3>");
               Response.Write("<div class='panel_para_categories'><ul id='catnav'>");
               List<GetCategoryResult> listChild = listCategory.Where(q => q.ParentID.HasValue).ToList();
               foreach (GetCategoryResult item in listChild)
               {
                   Response.Write("<li><a alt='" +
                   item.CategoryName + "' title='" + item.CategoryName + "' href='" + FRouter._("danh-muc",
                   item.Alias) + "'>" + item.CategoryName + "</li>");
               }
           }
           else
           {
               listCategory = (List<GetCategoryResult>)ViewData["CategoryMenu"];
        %>
        <div class="panel_header_categories">
            Danh mục</div>
        <div class="panel_para_categories">
            <ul id="catnav">
                <%
foreach (GetCategoryResult item in listCategory)
{
    Response.Write("<li><a alt='" + item.CategoryName + "' title='"
        + item.CategoryName + "' href='" + FRouter._("danh-muc", item.Alias) + "'>" + item.CategoryName + "</a></li>");
}
           } %>
            </ul>
        </div>
        <div class="panel_footer">
            <img src="../../../Themes/images/btm_categories.gif" /></div>
</div>
</div>
